<!DOCTYPE html>
<!--填写企业的相关信息,和编辑页面的信息对应 -->
<html lang="en">
	<head>
		<meta charset="utf-8">
<!-- 		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> -->
		<link rel="stylesheet" href="layui/css/layui.css">
		<script src="layui/layui.js"></script>
		<script src="mods/layarea.js"></script>

		<title>信息企业信息填写</title>
	</head>

	<body>
	<div class="layui-container">
		<div class="layui-row" >
	<div class='layui-col-md10'>

	<form class="layui-form" id='add_info' lay-filter="addinfo" onsubmit="return false">

		<div class="layui-form-item">
		  <label class="layui-form-label">机构代码</label>
		  <div class="layui-input-inline">
		    <input type="text" name="code"
					  required  lay-verify="required" placeholder="请输入企业标识码"
					  autocomplete="on" class="layui-input" lay-verType="alert">
		  </div>
		</div>


		  <div class="layui-form-item">
		    <label class="layui-form-label">企业名称</label>
		    <div class="layui-input-inline">
		      <input type="text" name="ename"
			  required  lay-verify="required" placeholder="请输入企业名称"
			  autocomplete="on" class="layui-input" lay-verType="alert">
		    </div>
		  </div>



		  <div class="layui-form-item">

		    <label class="layui-form-label">企业联系人</label>
		    <div class="layui-input-inline">
		      <input type="text" name="contacts"
			  required lay-verify="required" placeholder="请输入联系人姓名"
			  autocomplete="on" class="layui-input" lay-verType="alert">
		    </div>
		  </div>



		  <div class="layui-form-item">
		    <label class="layui-form-label">联系电话</label>
		    <div class="layui-input-inline">
		      <input type="text" name="telephone"
		  			  required lay-verify="required" placeholder="请输入联系电话"
					  autocomplete="on" class="layui-input" lay-verType="alert">
		    </div>
		  </div>

		  <div class="layui-form-item">
		    <label class="layui-form-label">企业邮箱</label>
		    <div class="layui-input-inline">
		      <input type="text" name="email"
		  			  required lay-verify="required|email" placeholder="请输入企业邮箱"
					  autocomplete="on" class="layui-input" lay-verType="alert">
		    </div>
		  </div>

		  <div class="layui-form-item">
		    <label class="layui-form-label">企业网址</label>
		    <div class="layui-input-inline">
		      <input type="text" name="website"
		  			  required lay-verify="required" placeholder="请输入企业网址"
					   autocomplete="on" class="layui-input"  lay-verType="alert">
		    </div>
		  </div>

		  <div class="layui-form-item" id="area-picker" >
		       <div class="layui-form-label">企业地址</div>
		            <div class="layui-input-inline" style="width: 200px;" autocomplete="on"  data-value='山东省' lay-filter="province-1">
		                <select name="province" class="province-selector" >
		                    <option value="">请选择省</option>
		                </select>
		            </div>
		            <div class="layui-input-inline" style="width: 200px;"autocomplete="on" data-value='泰安市' lay-filter="city-1" >
		                <select name="city" class="city-selector">
		                    <option value="">请选择市</option>
		                </select>
		            </div>
		            <div class="layui-input-inline" style="width: 200px;"autocomplete="on" data-value='泰山区' lay-filter="county-1">
		                <select name="area" class="county-selector" >
		                    <option value="">请选择区</option>
		                </select>
		           </div>
		        </div>
		<div class='layui-form-item'>
			<label class="layui-form-label">详细地址</label>
			<div class='layui-input-block'>
			<input type="text" name="address"
			lay-verify="required" placeholder="请输入企业详细地址"
			autocomplete="on" class="layui-input"  lay-verType="alert">
			</div>
		</div>

		  <div class="layui-form-item">
		    <label class="layui-form-label">企业类型</label>
		    <div class="layui-input-inline">
		      <select name="type" lay-verify="required" autocomplete="on">
		        <option value=""></option>
		        <option value="国有企业">国有企业</option>
		        <option value="民营企业">民营企业</option>
		        <option value="外资企业">外资企业</option>
		        <option value="其他类型企业">其他类型企业</option>
		      </select>
		    </div>
		  </div>

		  <div class="layui-form-item">
		    <label class="layui-form-label">企业性质</label>
		    <div class="layui-input-inline">
		    <select name="organize" lay-verify="required" autocomplete="on">
		      <option value=""></option>
		      <option value="世界500强企业">世界500强企业</option>
		      <option value="上市公司">上市公司</option>
		      <option value="龙头企业">龙头企业</option>
			  <option value="知名企业">知名企业</option>
		      <option value="其他类型企业">其他类型企业</option>
		    </select>
		    </div>

		  </div>

		<div class='layui-form-item'>
		  	<label class="layui-form-label">注册资金</label>
		  	<div class='layui-input-inline'>
		  	<input type="text" name="res-rmb"
		  	lay-verify="required" placeholder="注册资金(万元)"
		  	autocomplete="on" class="layui-input"  lay-verType="alert">
			 <span style=" position: absolute; top: 8%; right: 6%; display: table-cell;background-color: #FFFFFF;
			  white-space: nowrap; padding: 7px 10px;">万元</span>
		  </div>
		</div>

<!--			<div class='layui-form-item'>-->
<!--		  	<label class="layui-form-label">地址号</label>-->
<!--		  	<div class='layui-input-inline'>-->
<!--		  	<input type="text" name="location"-->
<!--		  	lay-verify="required" placeholder="地址编码"-->
<!--		  	autocomplete="on" class="layui-input"  lay-verType="alert">-->
<!--		  </div>-->
<!--		  </div>-->

		  <div class="layui-form-item">
		    <div class="layui-input-block">
		      <button class="layui-btn" lay-submit lay-filter="formAdd">提交</button>
		      <button type="button" class="layui-btn layui-btn-primary" onclick="window.history.go(-1)">返回</button>
		    </div>
		  </div>
		</form>
	</div>
		</div>
  </div>
</body>



<script type='text/javascript'>
		    //配置插件目录
		    layui.config({
		        base: '/mods/'
		    });

</script>
	<script>
		    //一般直接写在一个js文件中
			layui.use(['layer','form'],function(){
		        var layer = layui.layer
		            , form = layui.form
		            , layarea = layui.layarea;
					 $=layui.$;

		        layarea.render({
		            elem: '#area-picker',
		            change: function (res) {
		                //选择结果
		                // console.log(res);//控制台进行打印操作
		            }
		        });

				form.on('submit(formAdd)',function(data){
					var  json_temp=data.field;
					// json_temp["address"]=json_temp["province"]+json_temp["city"]+json_temp["county"]
					// 					+json_temp["detail_add"];

					// alert(JSON.stringify(json_temp));

					$.ajax({
						type:"POST",
						url:"/enter/fillInfo",
						data:json_temp,
						dataType:"json",
						success:function(result){
							if(result.code===200){
								layer.msg('增加成功',{},function(){
									window.location.href='main.html';
									window.location.reload();//跳转并刷新
								})
							}
							else{
								layer.msg(result.msg);
							}
						},
						error:function(){
							layer.msg('操作失败');
						}

					});



					// return false;


				});
		    });
		</script>




</html>
